<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template period</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.period_hpp" title="Header &lt;boost/date_time/period.hpp&gt;">
<link rel="prev" href="ymd_order_spec.html" title="Type ymd_order_spec">
<link rel="next" href="period_formatter.html" title="Class template period_formatter">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ymd_order_spec.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.period_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="period_formatter.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.date_time.period"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template period</span></h2>
<p>boost::date_time::period — Provides generalized period type useful in date-time systems. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#header.boost.date_time.period_hpp" title="Header &lt;boost/date_time/period.hpp&gt;">boost/date_time/period.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> point_rep<span class="special">,</span> <span class="keyword">typename</span> duration_rep<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">:</span> <span class="keyword">private</span> boost::less_than_comparable&lt; period&lt; point_rep, duration_rep &gt;, boost::equality_comparable&lt; period&lt; point_rep, duration_rep &gt; &gt; &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">point_rep</span>    <a name="boost.date_time.period.point_type"></a><span class="identifier">point_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">duration_rep</span> <a name="boost.date_time.period.duration_type"></a><span class="identifier">duration_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="period.html#boost.date_time.periodconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_8-bb"><span class="identifier">period</span></a><span class="special">(</span><span class="identifier">point_rep</span><span class="special">,</span> <span class="identifier">point_rep</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_9-bb"><span class="identifier">period</span></a><span class="special">(</span><span class="identifier">point_rep</span><span class="special">,</span> <span class="identifier">duration_rep</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7-bb">public member functions</a></span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_1-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_2-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_3-bb"><span class="identifier">last</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_rep</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_4-bb"><span class="identifier">length</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_5-bb"><span class="identifier">is_null</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_6-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_7-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">void</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_8-bb"><span class="identifier">shift</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_rep</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">void</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_9-bb"><span class="identifier">expand</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_rep</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_10-bb"><span class="identifier">contains</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_11-bb"><span class="identifier">contains</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_12-bb"><span class="identifier">intersects</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_13-bb"><span class="identifier">is_adjacent</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_14-bb"><span class="identifier">is_before</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_15-bb"><span class="identifier">is_after</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_16-bb"><span class="identifier">intersection</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_17-bb"><span class="identifier">merge</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a class="link" href="period.html#id-1_3_12_15_3_36_2_1_1_7_18-bb"><span class="identifier">span</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.12.15.3.35.4.4"></a><h2>Description</h2>
<p>This template uses a class to represent a time point within the period and another class to represent a duration. As a result, this class is not appropriate for use when the number and duration representation are the same (eg: in the regular number domain).</p>
<p>A period can be specified by providing either the begining point and a duration or the begining point and the end point( end is NOT part of the period but 1 unit past it. A period will be "invalid" if either end_point &lt;= begin_point or the given duration is &lt;= 0. Any valid period will return false for is_null().</p>
<p>Zero length periods are also considered invalid. Zero length periods are periods where the begining and end points are the same, or, the given duration is zero. For a zero length period, the last point will be one unit less than the begining point.</p>
<p>In the case that the begin and last are the same, the period has a length of one unit.</p>
<p>The best way to handle periods is usually to provide a begining point and a duration. So, day1 + 7 days is a week period which includes all of the first day and 6 more days (eg: Sun to Sat). </p>
<div class="refsect2">
<a name="id-1.3.12.15.3.35.4.4.7"></a><h3>
<a name="boost.date_time.periodconstruct-copy-destruct"></a><code class="computeroutput">period</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_12_15_3_36_2_1_1_8-bb"></a><span class="identifier">period</span><span class="special">(</span><span class="identifier">point_rep</span> first_point<span class="special">,</span> <span class="identifier">point_rep</span> end_point<span class="special">)</span><span class="special">;</span></pre>create a period from begin to last eg: [begin,end) <p>If end &lt;= begin then the period will be invalid </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_12_15_3_36_2_1_1_9-bb"></a><span class="identifier">period</span><span class="special">(</span><span class="identifier">point_rep</span> first_point<span class="special">,</span> <span class="identifier">duration_rep</span> len<span class="special">)</span><span class="special">;</span></pre>create a period as [begin, begin+len) <p>If len is &lt;= 0 then the period will be invalid </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.12.15.3.35.4.4.8"></a><h3>
<a name="id-1_3_12_15_3_36_2_1_1_7-bb"></a><code class="computeroutput">period</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a name="id-1_3_12_15_3_36_2_1_1_7_1-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return the first element in the period. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a name="id-1_3_12_15_3_36_2_1_1_7_2-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return one past the last element. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">point_rep</span> <a name="id-1_3_12_15_3_36_2_1_1_7_3-bb"></a><span class="identifier">last</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return the last item in the period. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_rep</span> <a name="id-1_3_12_15_3_36_2_1_1_7_4-bb"></a><span class="identifier">length</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return the length of the period. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_5-bb"></a><span class="identifier">is_null</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if period is ill formed (length is zero or less) </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_6-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Equality operator. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_7-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Strict as defined by rhs.last &lt;= lhs.last. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">void</span> <a name="id-1_3_12_15_3_36_2_1_1_7_8-bb"></a><span class="identifier">shift</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_rep</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre>Shift the start and end by the specified amount. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">void</span> <a name="id-1_3_12_15_3_36_2_1_1_7_9-bb"></a><span class="identifier">expand</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_rep</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre>
<p>Expands the size of the period by the duration on both ends.</p>
<p>So before expand </p>
<pre class="programlisting">        <span class="special">[</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">-</span><span class="special">]</span>
<span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>  <span class="special">^</span>
<span class="number">1</span>   <span class="number">2</span>   <span class="number">3</span>   <span class="number">4</span>   <span class="number">5</span>   <span class="number">6</span>  <span class="number">7</span>
</pre>
<p> After expand(2) </p>
<pre class="programlisting"><span class="special">[</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">]</span>
<span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>   <span class="special">^</span>  <span class="special">^</span>
<span class="number">1</span>   <span class="number">2</span>   <span class="number">3</span>   <span class="number">4</span>   <span class="number">5</span>   <span class="number">6</span>  <span class="number">7</span>
</pre>
<p> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_10-bb"></a><span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span> point<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if the point is inside the period, zero length periods contain no points. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_11-bb"></a><span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if this period fully contains (or equals) the other period. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_12-bb"></a><span class="identifier">intersects</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if the periods overlap in any way. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_13-bb"></a><span class="identifier">is_adjacent</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if periods are next to each other without a gap. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_14-bb"></a><span class="identifier">is_before</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span> point<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if all of the period is prior to the passed point or end &lt;= t. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_12_15_3_36_2_1_1_7_15-bb"></a><span class="identifier">is_after</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point_rep</span> <span class="special">&amp;</span> point<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>True if all of the period is prior or t &lt; start. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a name="id-1_3_12_15_3_36_2_1_1_7_16-bb"></a><span class="identifier">intersection</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns the period of intersection or invalid range no intersection. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a name="id-1_3_12_15_3_36_2_1_1_7_17-bb"></a><span class="identifier">merge</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns the union of intersecting periods – or null period. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="period.html" title="Class template period">period</a> <a name="id-1_3_12_15_3_36_2_1_1_7_18-bb"></a><span class="identifier">span</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="period.html" title="Class template period">period</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Combine two periods with earliest start and latest end. <p>Combines two periods and any gap between them such that start = min(p1.start, p2.start) end = max(p1.end , p2.end) </p>
<pre class="programlisting">       <span class="special">[</span><span class="special">--</span><span class="special">-</span><span class="identifier">p1</span><span class="special">--</span><span class="special">-</span><span class="special">)</span>
                      <span class="special">[</span><span class="special">--</span><span class="special">-</span><span class="identifier">p2</span><span class="special">--</span><span class="special">-</span><span class="special">)</span>
<span class="identifier">result</span><span class="special">:</span>
       <span class="special">[</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">-</span><span class="identifier">p3</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">--</span><span class="special">)</span> 
</pre>
<p> </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ymd_order_spec.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.period_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="period_formatter.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
